package com.ev.custom.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ev.common.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Objects;

/**
 * 文件名称： DieArchives.java
 * 初始作者： 胡苏明</br>
 * 功能说明： 【模具档案】 <br/>
 * =================================================<br/>
 * 修改记录：<br/>
 * 修改作者 日期 修改内容<br/>
 * ================================================<br/>
 * Copyright (c) 2019-2020 .All rights reserved.<br/>
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel("模具档案")
@TableName("cus_die_archives")
public class DieArchivesDO extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableField("die_archives_code")
    @ApiModelProperty("模具编号")
    private String dieArchivesCode;

    @TableField("die_archives_name")
    @ApiModelProperty("模具名称")
    private String dieArchivesName;

    @TableField("specs")
    @ApiModelProperty("规格型号")
    private String specs;

    @TableField("uom")
    @ApiModelProperty("计量单位")
    private String uom;

    @TableField(exist = false)
    @ApiModelProperty("计量单位名称")
    private String uomName;

    @TableField("remark")
    @ApiModelProperty("备注")
    private String remark;

    @TableField("status")
    @ApiModelProperty("状态 0-未审核；1-已审核")
    private Integer status;

    @TableField(exist = false)
    @ApiModelProperty("状态 0-未审核；1-已审核")
    private String statusName;

    public void setStatus(Integer status){
        this.status = status;
        if(Objects.equals(0,status)){
            this.statusName = "未审核";
        }
        if(Objects.equals(1,status)){
            this.statusName = "已审核";
        }
    }
}
